// eslint-disable-next-line no-unused-vars
import requestCommodity from '@/utils/request'

// 显示
export function CommodityList(query) {
  return requestCommodity({
    url: '/api/app/manual-prouct/product-dtos',
    method: 'get',
    params: query
  })
}

// 添加
export function createArticle(data) {
  return requestCommodity({
    url: '/api/app/product',
    method: 'post',
    data
  })
}

// 删除
export function deleteArticle(pv) {
  return requestCommodity({
    url: '/api/app/product/' + pv,
    method: 'delete'
  })
}

// 修改
export function updateArticle(data, id) {
  return requestCommodity({
    url: '/api/app/product/' + data.id,
    method: 'put',
    data
  })
}

// 产品分类
export function CategoryArticle(query) {
  return requestCommodity({
    url: '/api/app/category',
    method: 'get',
    params: query
  })
}

// 修改
export function UpdateState(data, id) {
  return requestCommodity({
    url: '/api/app/manual-prouct/' + data.id + '/state',
    method: 'put',
    data
  })
}

// 图片上传
export function CreateImg(data) {
  return requestCommodity({
    url: '/api/app/images/img',
    method: 'Post',
    data
  })
}
